package com.bwie.bill.controller;

import com.bwie.bill.service.BillService;
import com.bwie.common.domain.Bill;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：杨鹏
 * @Package：com.bwie.bill.controller
 * @Project：billManager
 * @name：BillController
 * @Date：2024/7/26 8:41
 */
@RestController
@RequestMapping("bill")
public class BillController {

    @Autowired
    private BillService billService;


    /**
     * 向表bill中添加数据的功能
     * @param bill
     * @return
     */
    @PostMapping("add")
    private Result add(@RequestBody Bill bill){
        return billService.add(bill);
    }

    /**
     * 查询表bill中的全部数据
     * @return
     */
    @GetMapping("list")
    private Result selectAll(){
        return billService.selectAll();
    }

}
